//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <cstdlib>

#include <iostream>
#include <fstream>

#include "ConvertPDBToSmileJChem.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
using namespace std;
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
int main(int argc, char** argv) {

  String* location;
  String* result;
  String* resultError;

  if (argc < 4) {
    cout << "Error in the input arguments. The execution must be: " << endl;
    cout << "./ConvertPDBToSmileForLigands <Path of the folder with pdb files> <outfile> <errorfile>" << endl;
    return 0;
  }
  else {
    cout << "---------------------------------------------------------------------------------" << endl;
    cout << "Reading files inside the folder: " << argv[1] << endl;
    cout << "            The Output File is : " << argv[2] << endl;
    cout << "             The Error File is : " << argv[3] << endl;
    cout << "---------------------------------------------------------------------------------" << endl;
    location    = new String(argv[1]);
    result      = new String(argv[2]);
    resultError = new String(argv[3]);
  }

  ConvertPDBToSmileJChem* convertPDBToSmileJChem = new ConvertPDBToSmileJChem();

  convertPDBToSmileJChem->LocationDB(location);
  convertPDBToSmileJChem->FilenameOut(result);
  convertPDBToSmileJChem->ListLigandError(resultError);
  convertPDBToSmileJChem->ConvertPDBLigandsToSmiles();

  cout << "---------------------------------------------------------------------------------" << endl;

  if (convertPDBToSmileJChem) delete convertPDBToSmileJChem;

  return 1;

}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//


